Skip to content

fix: mount spark-env.sh and security.properties - #761

Open
sweb wants to merge 2 commits into
mainfrom
fix/mount-files
Open

fix: mount spark-env.sh and security.properties#761
sweb wants to merge 2 commits into
mainfrom
fix/mount-files

Conversation

@sweb

@sweb sweb commented Aug 31, 2026

Copy link
Copy Markdown
Member

Description

spark-env.sh and security.properties were not mounted for SparkApplication. In addition, this PR adds validation of keys in spark-env.sh. Checking values would be even better, but that is quite involved and was not added here.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

@sweb
sweb marked this pull request as ready for review September 1, 2026 14:53
@sweb sweb self-assigned this Sep 2, 2026
@sweb sweb moved this to Development: Waiting for Review in Stackable Engineering Sep 2, 2026
@Maleware Maleware moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Sep 3, 2026
@Maleware
Maleware self-requested a review September 3, 2026 09:29
.collect::<Vec<String>>()
.join("\n")
.map(|(k, v)| {
ensure!(is_shell_identifier(k), InvalidSparkEnvShKeySnafu { key: k });

@Maleware Maleware Sep 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are variables such as UID, EUID, PPID, SHELLOPTS and BASH_VERSINFO which are read only. Those technically are valid in this check and pass it.

However they later get silently rejected with

/stackable/spark/conf/spark-env.sh: line 3: UID: readonly variable

They end up in the driver's pod as log statements so technically it's covered. Very Nit: Catch the obvious here as a warning.

@Maleware Maleware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected, all integration tests pass.

Good work thank you. Just one minor change request and a nit commet.

env = env.with_value(
&STACKABLE_PRE_HOOK,
format!(
"{pre_hook} . {VOLUME_MOUNT_PATH_CONFIG}/{SPARK_ENV_SH_FILE_NAME}; export SPARK_ENV_LOADED=1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works because this line ends with &.

I'd expect to either test for consistency or have a function extending it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

2 participants